package com.info.zhiduoduo.admin.controller;

import com.info.zhiduoduo.admin.model.dto.account.QuarterBusinessGrossDto;
import com.info.zhiduoduo.repository.dto.company.*;
import com.info.zhiduoduo.admin.model.formbean.account.CompanyAccountBalanceFormBean;
import com.info.zhiduoduo.admin.model.formbean.account.CompanyAccountFlowFormBean;
import com.info.zhiduoduo.admin.model.formbean.account.NotUpStandardMakerFormBean;
import com.info.zhiduoduo.admin.model.formbean.account.RenewTradeFormBean;
import com.info.zhiduoduo.admin.model.formbean.account.RenewWithdrawFormBean;
import com.info.zhiduoduo.admin.model.formbean.account.SaveHandleRecordFormBean;
import com.info.zhiduoduo.admin.model.formbean.account.TradeRecordListFormBean;
import com.info.zhiduoduo.admin.model.formbean.account.UserAccountFlowFormBean;
import com.info.zhiduoduo.admin.model.formbean.account.WithdrawListFormBean;
import com.info.zhiduoduo.admin.model.formbean.common.BatchManualErrorFormBean;
import com.info.zhiduoduo.admin.model.formbean.company.*;
import com.info.zhiduoduo.admin.service.AccountService;
import com.info.zhiduoduo.common.annotation.LogEntity;
import com.info.zhiduoduo.common.annotation.LogParameter;
import com.info.zhiduoduo.common.annotation.RepeatSubmitVerify;
import com.info.zhiduoduo.common.annotation.ZddLog;
import com.info.zhiduoduo.common.constants.SmartResult;
import com.info.zhiduoduo.common.constants.system.ZddLogType;
import com.info.zhiduoduo.common.formbean.BaseListFormBean;
import com.info.zhiduoduo.common.formbean.BaseSimpleFormBean;
import com.info.zhiduoduo.common.utils.DateUtil;
import com.info.zhiduoduo.repository.dto.account.CompanyAccountStatisticDto;
import com.info.zhiduoduo.repository.dto.account.CompanyCommissionStatisticDto;
import com.info.zhiduoduo.repository.dto.account.MonthCrowdSourceTradingVolumeDto;
import com.info.zhiduoduo.repository.dto.account.MonthZhiduoTradingVolumeDto;
import com.info.zhiduoduo.repository.dto.account.NotUpStandardDetailDto;
import com.info.zhiduoduo.repository.dto.account.NotUpStandardMakerDto;
import com.info.zhiduoduo.repository.dto.company.CompanyAccountBriefDto;
import com.info.zhiduoduo.repository.dto.company.CompanyZhaoshangSubLedgerIncomingRecordDto;
import com.info.zhiduoduo.repository.dto.pay.PaymentMerchantDto;
import com.info.zhiduoduo.repository.entity.company.CompanyRecharge;
import com.info.zhiduoduo.repository.entity.order.TradeRecord;
import com.info.zhiduoduo.repository.entity.partner.PartnerWithdraw;
import com.info.zhiduoduo.repository.entity.system.MonthBusinessGross;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.Date;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@Api(tags = "财务账户接口")
@RestController
@RequestMapping("/account")
public class AccountController {

	@Autowired
	AccountService accountService;

	/**
	 * 获取代付列表
	 */
	@PostMapping("/tradeRecordList")
	public SmartResult getTradeRecordList(@RequestBody BaseSimpleFormBean<TradeRecordListFormBean> formBean) {
		return accountService.getTradeRecordList(formBean);
	}

	/**
	 * 手动改为交易失败(支持批量)
	 */
	@ZddLog(type = ZddLogType.UPDATE, name = "手动改为交易失败(支持批量)", entities = @LogEntity(entity = TradeRecord.class, parameters =
	@LogParameter(fields = "tradeid", parameters = "formBean.reqdata.tradeid")))
	@ApiOperation("手动改为交易失败(支持批量)")
	@PostMapping("/batchManualError")
	public SmartResult batchManualError(@RequestBody BaseListFormBean<BatchManualErrorFormBean> formBean) {
		return accountService.batchManualError(formBean);
	}

	/**
	 * 当交易失败后，重新提交支付，新建交易
	 */
	@ZddLog(type = ZddLogType.UPDATE, name = "重新支付", entities = @LogEntity(entity = TradeRecord.class, parameters = @LogParameter(fields =
			"tradeid", parameters = "formBean.reqdata.tradeid")))
	@PostMapping("/repayTrade")
	public SmartResult repayTrade(@RequestBody BaseSimpleFormBean<RenewTradeFormBean> formBean) {
		return accountService.repayTrade(formBean);
	}
//
//	/**
//	 * 当交易失败后，重新提交支付，新建交易
//	 */
//	@ZddLog(type = ZddLogType.UPDATE, name = "重新支付（九歌）", entities = @LogEntity(entity = TradeRecord.class, parameters =
//	@LogParameter(fields = "tradeid", parameters = "formBean.reqdata.tradeid")))
//	@PostMapping("/repayJiugeTrade")
//	public SmartResult repayJiugeTrade(@RequestBody BaseSimpleFormBean<RenewTradeFormBean> formBean) {
//		return accountService.repayTrade(formBean);
//	}

	/**
	 * 获取提现列表
	 */
	@PostMapping("/withdrawList")
	public SmartResult getWithdrawList(@RequestBody BaseSimpleFormBean<WithdrawListFormBean> formBean) {
		return accountService.getWithdrawList(formBean);
	}

	/**
	 * 重新支付提现
	 */
	@ZddLog(type = ZddLogType.UPDATE, name = "重新支付提现", entities = @LogEntity(entity = PartnerWithdraw.class, parameters =
	@LogParameter(fields = "wdid", parameters = "formBean.reqdata.wdid")))
	@PostMapping("/repayWithdraw")
	public SmartResult repayWithdraw(@RequestBody BaseSimpleFormBean<RenewWithdrawFormBean> formBean) {
		return accountService.repayWithdraw(formBean);
	}

	// --------------------------- 企业账户充值 ---------------------------//

	/**
	 * 创建企业充值
	 */
	@ZddLog(name = "创建企业充值")
	@PostMapping("/createRecharge")
	public SmartResult createRecharge(@RequestBody BaseSimpleFormBean<CreateRechargeFormBean> formBean) {
		return accountService.createRecharge(formBean);
	}

	@ApiOperation("导出企业充值流水")
	@GetMapping("/exportCompanyRechargeFlow")
	public void exportCompanyRechargeFlow(HttpServletResponse response,
	                                      @ApiParam(name = "start", value = "开始时间") @RequestParam(name = "start") Long start,
	                                      @ApiParam(name = "end", value = "结束时间") @RequestParam(name = "end") Long end) {
		Date startDate = new Date(start);
		Date endDate = new Date(end);
		accountService.exportCompanyRechargeFlow(response, startDate, endDate);
	}

	/**
	 * 删除充值记录, 如果已完成则不能删除
	 */
	@ZddLog(type = ZddLogType.DELETE, name = "删除充值记录", entities = @LogEntity(entity = CompanyRecharge.class, parameters =
	@LogParameter(fields = "rechargeid", parameters = "formBean.reqdata")))
	@PostMapping("/delRecharge")
	public SmartResult delRecharge(@RequestBody BaseSimpleFormBean<Integer> formBean) {
		return accountService.delRecharge(formBean);
	}

	/**
	 * 充值记录列表
	 */
	@PostMapping("/rechargeList")
	public SmartResult getRechargeList(@RequestBody BaseSimpleFormBean<RechargeListFormBean> formBean) {
		return accountService.getRechargeList(formBean);
	}

	/**
	 * 下载充值记录列表
	 */
	@PostMapping("/downloadRechargeList")
	public void downloadRechargeList(@RequestBody BaseSimpleFormBean<RechargeListFormBean> formBean, HttpServletResponse response) {
		accountService.downloadRechargeList(formBean, response);
	}

	/**
	 * 确认充值完成
	 */
	@ZddLog(type = ZddLogType.UPDATE, name = "确认充值完成", entities = @LogEntity(entity = CompanyRecharge.class, parameters =
	@LogParameter(fields = "rechargeid", parameters = "formBean.reqdata.rechargeid")))
	@PostMapping("/confirmRecharge")
	@RepeatSubmitVerify(expireSeconds = 5)
	public SmartResult confirmRecharge(@RequestBody BaseSimpleFormBean<ConfirmRechargeFormBean> formBean) {
		return accountService.confirmRecharge(formBean);
	}

	/**
	 * 获取充值详情
	 */
	@PostMapping("/rechargeDetail")
	public SmartResult getRechargeDetail(@RequestBody BaseSimpleFormBean<Integer> formBean) {
		return accountService.getRechargeDetail(formBean);
	}

	/**
	 * 发送充值验证码,微信模板消息
	 */
	@ApiOperation("reqdata:int 充值id")
	@PostMapping("/sendRechargeVerifyCode")
	public SmartResult sendRechargeVerifyCode(@RequestBody BaseSimpleFormBean<Integer> formBean) {
		return accountService.sendRechargeVerifyCode(formBean);
	}

	/**
	 * 获取企业账户流水
	 */
	@PostMapping("/companyAccountFlow")
	public SmartResult getCompanyAccountFlow(@RequestBody BaseSimpleFormBean<CompanyAccountFlowFormBean> formBean) {
		return accountService.getCompanyAccountFlow(formBean);
	}

	/**
	 * 获取企业创客团账本流水
	 */
	@PostMapping("/companyMakerGrouponAccountFlow")
	public SmartResult getCompanyMakerGrouponAccountFlow(@RequestBody BaseSimpleFormBean<CompanyAccountFlowFormBean> formBean) {
		return accountService.getCompanyMakerGrouponAccountFlow(formBean);
	}

	/**
	 * 获取企业账户余额列表
	 */
	@PostMapping("/companyAccountBalanceList")
	public SmartResult<CompanyAccountBriefDto> getCompanyAccountBalanceList(
			@RequestBody BaseSimpleFormBean<CompanyAccountBalanceFormBean> formBean) {
		return accountService.getCompanyAccountBalanceList(formBean);
	}

	/**
	 * 获取所有企业账户的合计数据
	 */
	@PostMapping("/allCompanyAccountStatistic")
	public SmartResult<CompanyAccountStatisticDto> getAllCompanyAccountStatistic(@RequestBody BaseSimpleFormBean formBean) {
		return accountService.getAllCompanyAccountStatistic(formBean);
	}

	/**
	 * 获取所有企业账户的流水未提佣金和成本未提佣金
	 */
	@PostMapping("/allCompanyAccountNoCommission")
	public SmartResult<CompanyCommissionStatisticDto> allCompanyAccountNoCommission(@RequestBody BaseSimpleFormBean formBean) {
		return accountService.allCompanyAccountNoCommission(formBean);
	}

	/**
	 * 获取创客账户流水
	 */
	@PostMapping("/userAccountFlow")
	public SmartResult getUserAccountFlow(@RequestBody BaseSimpleFormBean<UserAccountFlowFormBean> formBean) {
		return accountService.getUserAccountFlow(formBean);
	}

	@ApiOperation(value = "下载交易记录", tags = "下载excel")
	@GetMapping("downloadTradeRecord")
	public void downloadTradeRecord(HttpServletResponse response, @RequestParam(name = "name", required = false) String name,
	                                @RequestParam(name = "startDate", required = false) Long start,
	                                @RequestParam(name = "endDate", required = false) Long end,
	                                @RequestParam(name = "tradetype", required = false, defaultValue = "0") int tradetype,
	                                @RequestParam(name = "tradestate", required = false, defaultValue = "0") int tradestate)
			throws IOException {
		Date startDate = null, endDate = null;
		if (start != null) {
			startDate = new Date(start);
		}
		if (end != null) {
			endDate = new Date(end);
		}
		TradeRecordListFormBean reqdata = new TradeRecordListFormBean(name, startDate, endDate, tradetype, tradestate);
		accountService.downloadTradeRecord(response, reqdata);
	}

	@ApiOperation(value = "下载企业账户流水", tags = "下载excel")
	@GetMapping("downloadCompAcctFlow")
	public void downloadCompAcctFlow(HttpServletResponse response,
	                                 @ApiParam(name = "name", value = "企业名") @RequestParam(name = "name", required = false) String name,
	                                 @ApiParam(name = "startDate", value = "开始时间") @RequestParam(name = "startDate", required = false) Long start,
	                                 @ApiParam(name = "endDate", value = "结束时间") @RequestParam(name = "endDate", required = false) Long end,
	                                 @ApiParam(name = "accountType", value = "账户类型") @RequestParam(name = "accountType", required = false) String accountType,
	                                 @ApiParam(name = "flowtype", value = "1：支出 2：收入") @RequestParam(name = "flowtype", required = false,
			                                 defaultValue = "0") int flowtype)
			throws IOException {
		Date startDate = null, endDate = null;
		if (start != null) {
			startDate = new Date(start);
		}
		if (end != null) {
			endDate = new Date(end);
		}
		CompanyAccountFlowFormBean reqdata = new CompanyAccountFlowFormBean(name, flowtype, startDate, endDate, accountType);
		accountService.downloadCompAcctFlow(response, reqdata);
	}

	@ApiOperation(value = "下载工作室账户流水", tags = "下载excel")
	@GetMapping("downloadStudioAcctFlow")
	public void downloadStudioAcctFlow(HttpServletResponse response,
	                                   @ApiParam(name = "name", value = "工作室名") @RequestParam(name = "name", required = false) String name,
	                                   @ApiParam(name = "startDate", value = "开始时间") @RequestParam(name = "startDate", required = false) Long start,
	                                   @ApiParam(name = "endDate", value = "结束时间") @RequestParam(name = "endDate", required = false) Long end,
	                                   @ApiParam(name = "flowtype", value = "1：支出 2：收入") @RequestParam(name = "flowtype", required = false
			                                   , defaultValue = "0") int flowtype)
			throws IOException {
		Date startDate = null, endDate = null;
		if (start != null) {
			startDate = new Date(start);
		}
		if (end != null) {
			endDate = new Date(end);
		}
		UserAccountFlowFormBean reqdata = new UserAccountFlowFormBean(name, flowtype, startDate, endDate);
		accountService.downloadStudioAcctFlow(response, reqdata);
	}

	@ApiOperation(value = "获取指定年份每季度业务毛利", notes = "reqdata:2019  int型年份")
	@PostMapping("businessGrossList")
	public SmartResult<QuarterBusinessGrossDto> getBusinessGrossList(@RequestBody BaseSimpleFormBean<Integer> formBean) {
		return accountService.getBusinessGrossList(formBean);
	}

	@ApiOperation(value = "获取指定年份每月度业务毛利", notes = "reqdata:2019  int型年份")
	@PostMapping("businessMonthGrossList")
	public SmartResult<MonthBusinessGross> getBusinessMonthGrossList(@RequestBody BaseSimpleFormBean<Integer> formBean) {
		return accountService.getBusinessMonthGrossList(formBean);
	}

	@GetMapping("calcMonthBusinessGrossJob")
	public SmartResult calcMonthBusinessGrossJob(
			@RequestParam(required = false) @DateTimeFormat(pattern = DateUtil.FORMAT_STYLE_2) Date from,
			@RequestParam(required = false) @DateTimeFormat(pattern = DateUtil.FORMAT_STYLE_2) Date to) {
		new Thread(() -> accountService.calcMonthBusinessGrossJob(from, to)).start();
		return SmartResult.success();
	}

	@ApiOperation("下载季度超过30万的创客列表")
	@GetMapping("/downloadQuarterStudioList")
	public void downloadQuarterStudioList(
			@ApiParam("指定年份,int型, 可不传,默认为今年") @RequestParam(value = "year", required = false, defaultValue = "0") int year,
			@ApiParam(value = "指定季度 1,2,3,4", required = true) @RequestParam("quarter") int quarter, HttpServletResponse response) {

		accountService.downloadQuarterStudioList(year, quarter, response);
	}
//
//	@ApiOperation("获取线下直接充值订单列表")
//	@PostMapping("/offlineRechargeOrderList")
//	public SmartResult<CompanyOfflineRechargeDto> getOfflineRechargeOrderList(
//			@RequestBody BaseSimpleFormBean<OfflineRechargeOrderListFormBean> formBean) {
//		return accountService.getOfflineRechargeOrderList(formBean);
//	}
//
//	@ApiOperation(value = "获取线下直接充值订单详情信息", notes = "reqdata 充值订单id")
//	@PostMapping("/offlineRechargeOrderDetail")
//	public SmartResult<CompanyOfflineRechargeDetailDto> getOfflineRechargeOrderDetail(@RequestBody BaseSimpleFormBean<Integer> formBean) {
//		return accountService.getOfflineRechargeOrderDetail(formBean);
//	}
//
//	/**
//	 * 发送充值验证码,微信模板消息
//	 */
//	@ApiOperation(value = "发送线下直充 充值验证码,微信模板消息", notes = "充值详情item的id")
//	@PostMapping("/sendOfflineRechargeVerifyCode")
//	public SmartResult sendOfflineRechargeVerifyCode(@RequestBody BaseSimpleFormBean<Integer> formBean) {
//		return accountService.sendOfflineRechargeVerifyCode(formBean);
//	}

	@ApiOperation("统计创客从提交审核资料日期开始算，12个月交易额未达到10万的创客列表")
	@PostMapping("/notUpStandardMakerList")
	public SmartResult<NotUpStandardMakerDto> notUpStandardMakerList(@RequestBody BaseSimpleFormBean<NotUpStandardMakerFormBean> formBean) {
		return accountService.notUpStandardMakerList(formBean);
	}

	@ApiOperation("统计创客从提交审核资料日期开始算，12个月交易额未达到10万的创客列表(导出)")
	@GetMapping("/notUpStandardMakerListImportExcel")
	public void notUpStandardMakerListImportExcel(HttpServletResponse httpServletResponse, String name, Integer type) {
		accountService.notUpStandardMakerListImportExcel(httpServletResponse, name, type);
	}

	@ApiOperation("下载 统计创客从开户日期算，12个月交易额未达到10万的创客列表")
	@GetMapping("/downloadNotUpStandardMakerList")
	public void downloadNotUpStandardMakerList(HttpServletResponse response, NotUpStandardMakerFormBean formBean) {
		accountService.downloadNotUpStandardMakerList(response, formBean);
	}

	@ApiOperation("获取12个月交易额未达到10万的创客的详情信息")
	@PostMapping("/notUpStandardMakerDetail")
	public SmartResult<NotUpStandardDetailDto> notUpStandardMakerDetail(@RequestBody BaseSimpleFormBean<Integer> formBean) {
		return accountService.notUpStandardMakerDetail(formBean);
	}

	@ZddLog(name = "保存处理结果")
	@ApiOperation("保存处理结果")
	@PostMapping("/saveHandleRecord")
	public SmartResult saveHandleRecord(@RequestBody @Validated BaseSimpleFormBean<SaveHandleRecordFormBean> baseSimpleFormBean) {
		return accountService.saveHandleRecord(baseSimpleFormBean);
	}

	/**
	 * 导出 未达到10万的创客列表
	 */
	@ApiOperation("导出 未达到10万的创客列表")
	@PostMapping("/exportNotUpStandardMakerList")
	public void exportNotUpStandardMakerList(@RequestBody BaseSimpleFormBean<NotUpStandardMakerFormBean> baseSimpleFormBean,
	                                         HttpServletResponse response) {
		accountService.exportNotUpStandardMakerList(baseSimpleFormBean, response);
	}

	@ApiOperation(value = "获取指定年份每月 交易额及总税费", notes = "reqdata:2020  int型年份")
	@PostMapping("getZhiduoTradingVolumeList")
	public SmartResult<MonthZhiduoTradingVolumeDto> getZhiduoTradingVolumeList(@RequestBody BaseSimpleFormBean<Integer> formBean) {
		return accountService.getZhiduoTradingVolumeList(formBean);
	}

	@ApiOperation(value = "获取指定年份每月 交易额及总税费", notes = "reqdata:2020  int型年份")
	@PostMapping("getTaxerTradingVolumeList")
	public SmartResult<MonthZhiduoTradingVolumeDto> getTaxerTradingVolumeList(@RequestBody BaseSimpleFormBean<Integer> formBean) {
		return accountService.getTaxerTradingVolumeList(formBean);
	}

	@ApiOperation(value = "获取指定年份每月纯代理交易额及总税费", notes = "reqdata:2020  int型年份")
	@PostMapping("getPureAgencyTradingVolumeList")
	public SmartResult<MonthZhiduoTradingVolumeDto> getPureAgencyTradingVolumeList(@RequestBody BaseSimpleFormBean<Integer> formBean) {
		return accountService.getPureAgencyTradingVolumeList(formBean);
	}

	@ApiOperation(value = "获取指定年份每月智众包交易额及总税费", notes = "reqdata:2020  int型年份")
	@PostMapping("getCrowdSourceTradingVolumeList")
	public SmartResult<MonthCrowdSourceTradingVolumeDto> getCrowdSourceTradingVolumeList(
			@RequestBody BaseSimpleFormBean<Integer> formBean) {
		return accountService.getCrowdSourceTradingVolumeList(formBean);
	}

	// 1、按月统计每个商务名下企业交易金额  ；
	@ApiOperation("统计商务名下的企业交易额")
	@PostMapping("/statisticCorporateAmount")
	public SmartResult statisticCorporateAmount(@RequestBody BaseSimpleFormBean<QueryCompanyAmountFromBean> baseSimpleFormBean) {
		return accountService.statisticCorporateAmount(baseSimpleFormBean);
	}

	@ApiOperation("统计商务名下的企业交易额明细")
	@PostMapping("/statisticCorporateAmountInfo")
	public SmartResult statisticCorporateAmountInfo(@RequestBody BaseSimpleFormBean<QueryCompanyAmountFromBean> baseSimpleFormBean) {
		return accountService.statisticCorporateAmountInfo(baseSimpleFormBean);
	}

	// 2、导出；列表显示：年月、商务、 交易、智众包交易额
	@ApiOperation("导出商务企业下的交易金额")
	@GetMapping("/exportBusinessCorporateAmount")
	public void exportBusinessCorporateAmount(QueryCompanyAmountFromBean fromBean, HttpServletResponse response) {
		accountService.exportBusinessCorporateAmount(fromBean, response);
	}

	//按月统计跟单员的企业交易额
	@ApiOperation("统计跟单员的企业交易额")
	@PostMapping("/statisticMerchandiser")
	public SmartResult statisticMerchandiser(@RequestBody BaseSimpleFormBean<QueryCompanyAmountFromBean> baseSimpleFormBean) {
		return accountService.statisticMerchandiser(baseSimpleFormBean);
	}

	@ApiOperation("按企业主体统计企业总余额")
	@PostMapping("/queryCompanyAmountByParty")
	public SmartResult queryCompanyAmountByParty(@RequestBody BaseSimpleFormBean baseSimpleFormBean) {
		return accountService.queryCompanyAmountByParty(baseSimpleFormBean);
	}

	@ApiOperation("根据企业主体查询企业余额列表")
	@PostMapping("/queryCompanyAmountByPartyList")
	public SmartResult queryCompanyAmountByPartyList(@RequestBody BaseSimpleFormBean<CompanyAccountBalanceFormBean> formBean){
		return accountService.queryCompanyAmountByPartyList(formBean);
	}

	@ApiOperation("导出企业余额（余额大于0的）")
	@GetMapping("/exportCompanyAmount")
	public void exportCompanyAmount(HttpServletResponse response,CompanyAccountBalanceFormBean formBean) {
		accountService.exportCompanyAmount(response, formBean);
	}

	@ApiOperation("查询不交易创客")
	@PostMapping("/getNonTradingMaker")
	public SmartResult getNonTradingMaker(@RequestBody BaseSimpleFormBean baseSimpleFormBean) {
		return accountService.getNonTradingMaker(baseSimpleFormBean);
	}

	@ApiOperation("获取 交易额")
	@PostMapping("/getTaxerAmount")
	public SmartResult getTaxerAmount(@RequestBody BaseSimpleFormBean<GetAmountFromBean> formBean) {
		return accountService.getTaxerAmount(formBean);
	}

	@ApiOperation("获取交易额")
	@PostMapping("/getAmount")
	public SmartResult getAmount(@RequestBody BaseSimpleFormBean<GetAmountFromBean> formBean) {
		return accountService.getAmount(formBean);
	}

	@ApiOperation("跟单员导出月度交易额")
	@GetMapping("/exportAmount")
	public void exportAmount(HttpServletResponse response, GetAmountFromBean formBean) throws IOException {
		accountService.exportAmount(response, formBean);
	}

	@ApiOperation("获取企业招商银行记账子单元转账汇入记录")
	@PostMapping("/listZhaoshangIncomingRecords")
	public SmartResult<CompanyZhaoshangSubLedgerIncomingRecordDto> listZhaoshangIncomingRecords(
			@RequestBody BaseSimpleFormBean<ZhaoshangSubLedgerIncomingRecordListFormBean> formBean) {
		return accountService.listZhaoshangIncomingRecords(formBean);
	}

	@ApiOperation("审核企业招商银行记账子单元转账汇入操作")
	@PostMapping("/verifyZhaoshangIncomingRecordOperation")
	public SmartResult verifyZhaoshangIncomingRecordOperation(@Valid @RequestBody BaseSimpleFormBean<VerifyIncomingRecordOperationFormBean> formBean) {
		return accountService.verifyZhaoshangIncomingRecordOperation(formBean);
	}

	@ApiOperation("保存招商银行记账子单元汇款记录手动退款回单")
	@PostMapping("/saveZhaoshangIncomingRefundReceipt")
	public SmartResult saveZhaoshangIncomingRefundReceipt(
			@RequestBody BaseSimpleFormBean<ZhaoshangIncomingRefundReceiptFormBean> formBean) {
		return accountService.saveZhaoshangIncomingRefundReceipt(formBean);
	}

	@ApiOperation("获取招商银行的商户列表")
	@GetMapping("/listZhaohangMerchant")
	public SmartResult<PaymentMerchantDto> listZhaoshangMerchant() {
		return accountService.listZhaoshangMerchant();
	}

	@ApiOperation("商务导出月度交易额明细")
	@GetMapping("/exportStatisticCorporateAmount")
	public void exportStatisticCorporateAmount(HttpServletResponse response, ExportStatisticCorporateAmountFromBean formBean) throws IOException {
		accountService.exportStatisticCorporateAmount(response, formBean);
	}

	@ApiOperation("申请退款列表")
	@PostMapping("/requestRefundList")
	public SmartResult<RequestRefundListDto> requestRefundList(@RequestBody  BaseSimpleFormBean<RequestRefundListFromBean> formBean) {
		return accountService.requestRefundList(formBean);
	}

	@ApiOperation("取消申请退款 传申请退款id")
	@PostMapping("/cancellationForARefund")
	public SmartResult cancellationForARefund(@RequestBody BaseSimpleFormBean<ConfirmRequestForRefundFromBean> formBean) {
		return accountService.cancellationForARefund(formBean);
	}

	@ApiOperation("确认申请退款")
	@PostMapping("/confirmRequestForRefund")
	public SmartResult confirmRequestForRefund(@RequestBody BaseSimpleFormBean<ConfirmRequestForRefundFromBean> formBean) {
		return accountService.confirmRequestForRefund(formBean);
	}


	@ApiOperation("判断金额充值")
	@PostMapping("/amountTopUp")
	public SmartResult<AmountTopUpDto> amountTopUp(@RequestBody BaseSimpleFormBean<AmountTopUpFormBean> formBean) {
		return accountService.amountTopUp(formBean);
	}
}
